Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Uppy integration #2059

Open
wants to merge 5 commits into
base: craft-4
Choose a base branch
from
Open

Add Uppy integration #2059

wants to merge 5 commits into from

Conversation

IrateGod
Copy link

@IrateGod IrateGod commented Sep 6, 2024

As discussed in detail in #133, there is currently no out-of-the-box solution for web browsers to display already uploaded files in a native <input type="file"> field. This Pull Request aims to alleviate that issue by integrating Uppy into the File Upload JS, as well as adding a new Controller that will take care of the user's file submission and file deletion. The special file upload field template is also updated to reflect on the change by adding some extra information that Uppy requires in the HTML data- attributes.

Known issues currently are:

  • The settings for Uppy are not configurable by the end user. There should be an event exposed before the Uppy integration is loaded.
  • The asset upload and delete actions are not thoroughly tested in their functionality, Craft's own AssetControllerTrait was used as reference but I could not test it extensively past my own development environment.
  • This integration is based on Formie v2, and might need to be refactored again for v3.

That aside, I would be more than happy to talk about the solution I've provided, and will gladly make any required changes.

@engram-design
Copy link
Member

Thanks so much for putting this together, it's been on our list for a while, and due to be tackled in 2.2.0/3.1.0.

I'll have to take some time to thoroughly test this with all aspects of Formie, but it's an amazing start at the very least. There's been a few workarounds to make File Upload fields accommodate this lack of feature set, and it's also something we'd want users to opt into.

I'll put this on my list to review in detail.

@IrateGod
Copy link
Author

I've updated my fork with the changes I've made to ensure File Upload fields within Repeater fields get their Assets uploaded to the correct Row, using the recently added data-repeater-row-id property, which does appear to be working in my local testing environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants